<template>
    <div>
         <el-select size="mini" 
                clearable
                filterable
                v-model="staffId"
                @change="changeData"
                placeholder="请选择">
               <el-option
                v-for="item in userList"
                :key="item.data.id"
                :label="item.data.customerCateName"
                :value="item.data.id">
            </el-option>
    </el-select>
</div>
</template>
<script>
 import  {findCusCustomerCate}  from '@/api/user'
  export default {
      props:{
       value:{
           type:[Number,String],
           default(){
               return ''
           }
       }
      },
    watch:{
      value(){
         this.staffId = this.value||''
     }
    },
    data() {
      return { 
          userList:[],
          staffId:''
      }
    },
    mounted(){
      this.findCusCustomerCate()
    },
    methods: {
     findCusCustomerCate(){
          findCusCustomerCate({
             data:{},
             page: 1,
             pageSize:999
          }).then((res)=>{
             if(res.code==0){
                this.userList = res.data.data
             }
          })
     },
     changeData(val){
         console.log(val)
         this.$emit('input',val)
     }
    }
  }
</script>
<style scoped>
.el-form{
  display: flex;
  flex-wrap: wrap;
  justify-content:flex-start;
}
.el-form-item__label{
    color: #666;
    font-weight: normal;
}

</style>